﻿      @Html.DevExpress().Calendar(x=>
 {
     x.Name = "Calendar12";
     x.VisibleDate = DateTime.Parse(ViewData["Year"] + "-01-01");
     x.Properties.EnableMonthNavigation = false;
     x.Properties.EnableYearNavigation = true;
     x.Properties.ShowClearButton = false;
     x.Properties.ShowTodayButton = false;
     x.Properties.Columns = 4;
     x.Properties.Rows = 3;
     x.Properties.ClientSideEvents.SelectionChanged = "function(s,e){check(s,e)}";
     x.CallbackRouteValues = new { Controller = "WorkCalendar", Action = "CalendarPartial" };

     x.Properties.DayNameFormat = System.Web.UI.WebControls.DayNameFormat.Short;
     
    // x.Properties.DaySelectedStyle.BackColor = DXColor.Yellow;
     
     //List<string> List = ViewData["content"] as List<string>;
     //if (List != null)
     //{
     //    //x.SelectedDates.Clear();
     //    foreach (string str in List)
     //    {
     //        x.SelectedDates.Add(DateTime.Parse(str));
     //    }
     //}
     
     //x.Properties.ClientSideEvents.ValueChanged = "function(s,e){check2(s,e)}";
     //x.Properties.DaySelectedStyle.BackColor = DXColor.Red;

     //x.DayCellInitialize = (sender, e) => 
     //{
     //    if (e.IsSelected == true)
     //    {
            

     //    }

     //};

     
     
     
     //x.DayCellCreated = (sender, e) =>
     //{
     //    if (e.IsSelected == true)
     //    {

         
     //    }

     //};

     List<string> List = ElingOA6_Admin_DSJCJ.Common.OperateSession.getList<string>("YDayList");

     List<string> GList = ElingOA6_Admin_DSJCJ.Common.OperateSession.getList<string>("GDayList");
     
     x.DayCellPrepared = (sender, e) =>
     {

         //string[] List = ViewData["content"].ToString().Split(new string [] {"^-^"},StringSplitOptions.RemoveEmptyEntries);
         if (List != null)
         {
             if (List.Contains(e.Date.ToString()))
             {
                 e.Cell.BackColor = System.Drawing.Color.Yellow;
                 e.TextControl.Font.Bold = true;
             }

             if (GList.Contains(e.Date.ToString()))
             {
                 e.Cell.BackColor = System.Drawing.Color.GreenYellow;
                 e.TextControl.Font.Bold = true;
             }
         }

     };

 }
 ).GetHtml()

